package com.mymarkdown.app.fx.event.hander.impl;

import com.mymarkdown.app.fx.event.hander.MenuHandler;
import com.mymarkdown.app.fx.event.model.FxEvent;
import com.mymarkdown.app.util.FxShowWindowUtil;
import javafx.scene.web.WebEngine;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author zenglun
 * @date 2021/12/15 9:50 上午
 * @description: TODO
 */
@Slf4j
@Component
public class SystemSettingMenuHandlerImpl implements MenuHandler {

    @Value("${fx.app.system.setting.page}")
    private String systemSettingPage;

    @Value("${fx.app.system.setting.min-width}")
    private Integer systemMinWidth;

    @Value("${fx.app.system.setting.title}")
    private String systemTitle;

    @Value("${fx.app.system.setting.min-height}")
    private Integer systemMinHeight;



    @Override
    public void handler(WebEngine engine, FxEvent event) {
        FxShowWindowUtil.empty(systemSettingPage).setMinWidth(systemMinWidth).setTitle(systemTitle)
                .setMinHeight(systemMinHeight).showWindow();
    }
}
